<!DOCTYPE html>
<html>
<head>
    <title>工装清单</title>
    #parse("sys/header.html")
    <style>
        .ui-jqgrid {
            width: 100%;
            float: right;
        }
            .col-sm-2 {
                width: 30%;
            }
        .sugon_upload_btn {
            display: -webkit-inline-box;
            display: inline-block;
        }
         .details td, .details th{
             vertical-align: text-bottom;
         }
        .leftHeight{
            height: 85vh;
            overflow: auto;
        }
        ::-webkit-scrollbar{
            width: 10px;
            height: 10px;
        }
        ::-webkit-scrollbar-thumb{
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #a8a5a5;
        }
        .workShop{
            position: absolute;
            top: 0;
            width: 100%;
            height: 25px;
            background-color: white;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="3">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.mapNo" @on-enter="query" placeholder="图号"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.type" @on-enter="query" placeholder="规格"></i-input>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("toolslist:import"))
                <Upload ref="uploadFile"
                        action="../toolslist/import"
                        :format="['xlsx','xls']"
                        :before-upload="handleBeforeUpload"
                        :on-success="handleSuccess" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="error"><i class="fa fa-hand-o-down"></i>&nbsp;导入</i-button>
                </Upload>
                #end
                #if($shiro.hasPermission("toolslist:export"))
                <i-button type="success" @click="exportData"><i class="fa fa-hand-o-up"></i>&nbsp;导出</i-button>
                #end
                #if($shiro.hasPermission("toolslist:review1"))
                <i-button type="primary" @click="deptCheck"><i class="fa fa-gavel"></i>&nbsp;技术质量室审核</i-button>
                #end
                <!--      <i-button type="primary" @click="review2"><i class="fa fa-gavel"></i>&nbsp;工程师审核</i-button>-->
                #if($shiro.hasPermission("toolsfile:list"))
                <i-button type="info" @click="goToolsFile"><i class="fa fa-bars"></i>&nbsp;工装档案</i-button>
                #end
                #if($shiro.hasPermission("toolslist:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("toolslist:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("toolslist:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <Row  :gutter="16" style="margin: 8px 0px 0px 1px;">
            <i-col :xs="4" :sm="4" :md="4" :lg="4">
                <div class="leftHeight" >
                    <div class="workShop">
                        <p class="text-center" style="font-size: 15px;">工厂/基地</p>
                    </div>
                    <div id="storeLayer" style="margin-top: 25px">
                        <ul id="deptTree" class="ztree"></ul>
                    </div>
                </div>
            </i-col>
            <i-col :xs="20" :sm="20" :md="20" :lg="20">
                <table  id="jqGrid"></table>
            </i-col>
        </Row>
    </div>
    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="toolslist" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11">
                    <Form-item label="名称" prop="name">
                        <i-input v-model="toolslist.name" placeholder="名称" icon="md-arrow-dropdown-circle"  readonly @on-click="getToolsbaseSelect"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" v-if="toolslist.id.length>0" offset="1">
                    <Form-item label="工装编号" prop="toolsCode">
                        <i-input v-model="toolslist.toolsCode" placeholder="工装编号" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="图号" prop="mapNo">
                        <i-input v-model="toolslist.mapNo" placeholder="未设置" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="1">
                    <Form-item label="自制图号" prop="createNo">
                        <i-input v-model="toolslist.createNo" placeholder="未设置" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="型号规格" prop="type">
                        <i-input v-model="toolslist.type" placeholder="未设置" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="1">
                    <Form-item label="适用机型" prop="applicableModel">
                        <i-input v-model="toolslist.applicableModel" placeholder="未设置" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="工装类别" prop="toolsType">
                        <i-select v-model="toolslist.toolsType" placeholder="工装类别" disabled>
                            <i-option v-for="item in toolstypeList" :value="item.typeCode" :key="item.typeCode">{{item.typeName}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="1">
                    <Form-item label="管控方式">
                        <i-select v-model="toolslist.controlWayArray" multiple placeholder="管控方式" disabled >
                            <i-option v-for="item in toolscontrolwayList" :value="item.controlCode" :key="item.id">
                                {{item.controlName}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="是否易损件" prop="isVulnerable">
                        <Radio-group v-model="toolslist.isVulnerable">
                            <Radio :label="0" disabled>
                                <span>否</span>
                            </Radio>
                            <Radio :label="1" disabled>
                                <span>是</span>
                            </Radio>
                        </Radio-group>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="1">
                    <Form-item label="现场装机总量" prop="capacity">
                        <Input-number :min="1" v-model="toolslist.capacity" placeholder="现场装机总量" style="width: 100%"></Input-number>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Row>
                        <i-col span="12">
                            <Form-item label="生产线" prop="productLineName">
                                <i-input v-model="toolslist.productLineName" readonly="readonly" placeholder="生产线"></i-input>
                            </Form-item>
                        </i-col>
                        <i-col span="3">
                            <Form-item :label-width="1">
                                <i-button @click="deptTreeShow" icon="md-arrow-dropdown-circle" >选择生产线</i-button>
                            </Form-item>
                        </i-col>
                    </Row>
                </i-col>
                <i-col span="11" offset="1">
                    <Form-item label="使用工序" prop="useProcedure">
                        <i-input v-model="toolslist.useProcedure" placeholder="请输入使用工序"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="备注信息" prop="remark">
                        <i-input type="textarea" v-model="toolslist.remark" placeholder="请输入备注信息"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">
                返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
    <!-- 审核表单区域 -->
    <div id="reviewLayer" style="display: none;">
        <form class="form-horizontal" style="width: 500px;">
            <div class="form-group">
                <div class="form-group">
                    <div class="col-sm-2 control-label">审核状态</div>
                    <div class="col-sm-8" style="margin-top: 6px">
                        <Radio-group v-model="approveParam.status">
                            <Radio :label="1"><span>通过</span></Radio>
                            <Radio :label="2"><span>不通过</span></Radio>
                        </Radio-group>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label">备注</div>
                    <div class="col-sm-8" style="margin-top: 6px">
                        <i-input type="textarea" v-model="approveParam.remark" placeholder="审批备注"></i-input>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<div id="categoryLayer" style="display: none;padding:10px;">
    <ul id="categoryTree" class="ztree"></ul>
</div>

<script src="${rc.contextPath}/js/tools/toolslist.js?_${date.systemTime}"></script>
</body>
</html>
